package imnu.work.imnu0715_work03.work_02.oop;

/**
 * @author: lys
 * @类名: SalesEmployee
 * @Title:
 * @date: 2020/7/15
 **/
public class SalesEmployee extends ColEmployee {
    //定义属性
    private int saleNum;
    private double saleRate;

    //构造方法
    public SalesEmployee(){}
    public SalesEmployee(String empName,int empMonth,int saleNum,double saleRate){
        super(empName,empMonth);
        this.saleNum = saleNum;
        this.saleRate = saleRate;
    }

    //getSalary方法,获取按售额和提成率拿工资的员工的工资
    public double getSalary(int month){
        //本月过生日
        if(month == super.getEmpMonth()){
            return saleNum*saleRate+100;
        }else{
            //本月不过生日
            return saleNum*saleRate;
        }
    }

    //getter和setter方法
    public double getSaleNum() {
        return saleNum;
    }

    public void SaleNum(int saleNum) {
        this.saleNum = saleNum;
    }

    public double getSaleRate() {
        return saleRate;
    }

    public void setSaleRate(double saleRate) {
        this.saleRate = saleRate;
    }
}
